<template>
  <div class="wrapper">
      <div class="stat">当前已经为广大用户完成<span class="user-count">{{num.toLocaleString()}}</span>份回收</div>
      <router-link class="immediate-use" to="/guide">立即使用</router-link>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: 0,
      target: 1136483790,
      step: 1,
    };
  },

  created() {
    this.grow();
  },

  methods: {
    grow() {
      setTimeout(() => {
        this.num += Math.round(Math.random() * 50000000);
        if (this.num < this.target) {
          this.grow();
        }
      }, 20);
    },
  },
};
</script>

<style lang="scss" scoped>

.wrapper{
  display: flex;
  justify-content: space-between;
  align-items:center;
  padding: 47px 20px;
  border-bottom: 1px solid #dddddd;
}

.stat{
  color: #999999;
  font-size: 14px;
}

.user-count{
  color: #58a6e7;
  font-size: 30px;
  margin-left: 2px;
  margin-right: 2px;
}

.immediate-use{
  box-sizing: border-box;
  display: inline-block;
  color: #fff;
  height: 48px;
  background: #80c200;
  text-decoration: none;
  border:1px solid #80c200;
  border-radius: 7px;
  font-size: 18px;
  padding: 0 41px;
  line-height: 48px;
}
</style>
